﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;

namespace LuoYi.Admin.Entities;

/// <summary>
/// 菜单权限表
/// </summary>
[Table("sys_menu")]
public class SysMenu : IEntity
{
    /// <summary>
    /// 菜单ID
    /// </summary>
    [Key]
    [Column("menu_id", TypeName = "bigint(20)")]
    public long MenuId { get; set; }

    /// <summary>
    /// 菜单名称
    /// </summary>
    [Column("menu_name")]
    [StringLength(50)]
    public string MenuName { get; set; } = null!;

    /// <summary>
    /// 父菜单ID
    /// </summary>
    [Column("parent_id", TypeName = "bigint(20)")]
    public long? ParentId { get; set; }

    /// <summary>
    /// 显示顺序
    /// </summary>
    [Column("order_num", TypeName = "int(4)")]
    public int? OrderNum { get; set; }

    /// <summary>
    /// 路由地址
    /// </summary>
    [Column("path")]
    [StringLength(200)]
    public string? Path { get; set; }

    /// <summary>
    /// 组件路径
    /// </summary>
    [Column("component")]
    [StringLength(255)]
    public string? Component { get; set; }

    /// <summary>
    /// 路由参数
    /// </summary>
    [Column("query")]
    [StringLength(255)]
    public string? Query { get; set; }

    /// <summary>
    /// 路由名称
    /// </summary>
    [Column("route_name")]
    [StringLength(50)]
    public string? RouteName { get; set; }

    /// <summary>
    /// 是否为外链（0是 1否）
    /// </summary>
    [Column("is_frame", TypeName = "int(1)")]
    public int? IsFrame { get; set; }

    /// <summary>
    /// 是否缓存（0缓存 1不缓存）
    /// </summary>
    [Column("is_cache", TypeName = "int(1)")]
    public int? IsCache { get; set; }

    /// <summary>
    /// 菜单类型（M目录 C菜单 F按钮）
    /// </summary>
    [Column("menu_type")]
    [StringLength(1)]
    public string? MenuType { get; set; }

    /// <summary>
    /// 菜单状态（0显示 1隐藏）
    /// </summary>
    [Column("visible")]
    [StringLength(1)]
    public string? Visible { get; set; }

    /// <summary>
    /// 菜单状态（0正常 1停用）
    /// </summary>
    [Column("status")]
    [StringLength(1)]
    public string? Status { get; set; }

    /// <summary>
    /// 权限标识
    /// </summary>
    [Column("perms")]
    [StringLength(100)]
    public string? Perms { get; set; }

    /// <summary>
    /// 菜单图标
    /// </summary>
    [Column("icon")]
    [StringLength(100)]
    public string? Icon { get; set; }

    /// <summary>
    /// 创建者
    /// </summary>
    [Column("create_by")]
    [StringLength(64)]
    public string? CreateBy { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("create_time", TypeName = "datetime")]
    public DateTime? CreateTime { get; set; }

    /// <summary>
    /// 更新者
    /// </summary>
    [Column("update_by")]
    [StringLength(64)]
    public string? UpdateBy { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column("update_time", TypeName = "datetime")]
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [Column("remark")]
    [StringLength(500)]
    public string? Remark { get; set; }
}
